#!/usr/bin/env python
# -*-coding:utf-8-*-
# File    : liyuqi.py
# Date    : 2021-01-15
# Author  : Tom.Lee


# numList = [5,8,1,9,23,88,4]
numList = [1,2,3,4]

#完全遍历法
length = len(numList)
# for i in range(length):
#     for z in range(length):
#         if numList[i]>numList[z]:
#             numList[i],numList[z] = numList[z],numList[i]
#
# print(numList)

#冒泡排序法
# count =0
# for i in range(length):
#     for n in range(i+1, length):
#         if numList[n]>numList[i]:
#             numList[i], numList[n] = numList[n], numList[i]
#         count += 1
# print(count)
# print(numList)

#使用列表的sort方法
numList.sort(reverse=True)
print(numList)